
#ifdef PBC_INTERNAL_SCRIPT

bool Script::HasValidPbcSource() {
#if V8_MAJOR_VERSION == 11
  Object src = this->pbc_source();
  if (!src.IsString()) return false;
  String src_str = String::cast(src);
#else
  auto src = this->pbc_source();
  if (!IsString(src)) return false;
  Tagged<String> src_str = Cast<String>(src);
#endif
  if (StringShape(src_str).IsExternal()) return false;
  return true;
}

#endif